﻿namespace SvGame.Logic;

public static partial class GameLogic
{
    public static void AgeTicksAdd(this Player player)
    {
        if (player.Room.NoTime)
        {
            return;
        }
        player.AgeSeconds++;
    }
    public static void AgeUpdate(this Player player)
    {
        player.Age = (int)(14 + TimeSpan.FromSeconds(player.AgeSeconds).TotalDays);
    }
    public static void ExpAdd(this Player player, long count)
    {
        player.Exp += count;
        foreach (var item in ConfDescLevel.Values)
        {
            if (player.Level < item.Id && player.Exp >= item.Exp)
            {
                player.Level = item.Id;
            }
        }
    }
    
}
